package com.lineage.server.clientpackets;

import com.lineage.echo.ClientExecutor;
import com.lineage.server.datatables.DungeonTable;
import com.lineage.server.model.Instance.L1PcInstance;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class C_EnterPortal extends ClientBasePacket {
  private static final Log _log = LogFactory.getLog(C_EnterPortal.class);
  
  public void start(byte[] decrypt, ClientExecutor client) {
    try {
      read(decrypt);
      L1PcInstance pc = client.getActiveChar();
      pc.isGhost();
      if (pc.isDead() || pc.isTeleport())
        return; 
      int locx = readH();
      int locy = readH();
      if (pc.isTeleport())
        return; 
      DungeonTable.get().dg(locx, locy, pc.getMap().getId(), pc);
    } catch (Exception exception) {
    
    } finally {
      over();
    } 
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
